package com.balabala.api;

import com.balabala.dto.UserInfoDto;
import com.balabala.dto.UserNameDto;
import com.balabala.result.Result;
import com.balabala.vo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import com.balabala.vo.UserNameVo;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @Author 何涛
 * @Date: 2023/05/05/ 15:16
 * @description 用户远程调用接口
 */
@FeignClient(value = "gym-user-service",contextId = "userFeign")
public interface UserFeignClient {

    /**
     * 获取用户信息
     * @param userToken
     * @return
     */
    @GetMapping("/app/user/getUserInfoByUserToken")
    Result<UserInfoDto> getUserInfoByUserToken(@RequestParam String userToken);

    @GetMapping("/admin/user/{id}")
    public Result<User> findById(@PathVariable Long id);

    //根据用户名模糊查询vipid
    @PostMapping("/admin/user/findVipIdBy")
    Result <List<UserNameVo>>findVipIdBy(@RequestBody UserNameDto userNameDto);

}
